import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common";
import { FormsModule, ReactiveFormsModule } from "@angular/forms";

// ng-zorro
import { NzDrawerModule } from "ng-zorro-antd/drawer";
import { NzFormModule } from "ng-zorro-antd/form";
import { NzInputModule } from "ng-zorro-antd/input";
import { NzModalModule } from "ng-zorro-antd/modal";
import { NzTabsModule } from "ng-zorro-antd/tabs";
import { NzRadioModule } from "ng-zorro-antd/radio";
import { NzToolTipModule } from "ng-zorro-antd/tooltip";
import { NzPopconfirmModule } from "ng-zorro-antd/popconfirm";
import { NzSliderModule } from "ng-zorro-antd/slider";
import { NzDatePickerModule } from "ng-zorro-antd/date-picker";
import { NzButtonModule } from "ng-zorro-antd/button";
import { NzNotificationModule } from "ng-zorro-antd/notification";
import { NzSelectModule } from "ng-zorro-antd/select";
import { NzSwitchModule } from "ng-zorro-antd/switch";

const NG_ZORRO_MODULES = [
    NzDrawerModule,
    NzInputModule,
    NzFormModule,
    NzTabsModule,
    NzModalModule,
    NzRadioModule,
    NzToolTipModule,
    NzPopconfirmModule,
    NzSliderModule,
    NzDatePickerModule,
    NzButtonModule,
    NzNotificationModule,
    NzSelectModule,
    NzSwitchModule,
];

// 边
import { PedgeComponent } from "./components/pedge/pedge.component";

// 节点
import { ActionPnodeSmsComponent } from "./components/pnode/action/action-pnode-sms/action-pnode-sms.component";
import { ActionPnodeEmailComponent } from "./components/pnode/action/action-pnode-email/action-pnode-email.component";
import { ActionComponent } from "./components/pnode/action/action.component";
import { ProcessComponent } from "./components/pnode/process/process.component";
import { ProcessCanvasComponent } from "./components/process-canvas/process-canvas.component";
import { HelperComponent } from "./components/pnode/helper/helper.component";
import { ConditionComponent } from "./components/pnode/condition/condition.component";
import { ConditionPnodeTimeComponent } from "./components/pnode/condition/condition-pnode-time/condition-pnode-time.component";

// 动作节点
const ACTION_PNODE_COMPONENTS = [
    ActionPnodeSmsComponent,
    ActionPnodeEmailComponent,
];

// 条件节点
const CONDITON_PNODE_COMPONENTS = [ConditionPnodeTimeComponent];

@NgModule({
    declarations: [
        ...ACTION_PNODE_COMPONENTS,
        ...CONDITON_PNODE_COMPONENTS,
        ActionComponent,
        ConditionComponent,
        ProcessComponent,
        ProcessCanvasComponent,
        PedgeComponent,
        HelperComponent,
    ],
    imports: [
        CommonModule,
        FormsModule,
        ReactiveFormsModule,
        ...NG_ZORRO_MODULES,
    ],
    exports: [
        CommonModule,
        FormsModule,
        ReactiveFormsModule,
        ActionComponent,
        ConditionComponent,
        ProcessComponent,
        ProcessCanvasComponent,
        PedgeComponent,
        HelperComponent,
        ...NG_ZORRO_MODULES,
    ],
})
export class SharedModule {}
